//package com.fy.fyspace.mq.producer;
//
//import com.fy.fyspace.common.config.RabbitMQConfig;
//import com.fy.fyspace.constant.MQConstant;
//import com.fy.fyspace.ex.ConditionException;
//import com.fy.fyspace.model.mq.ImageOutPaintingMessage;
//import com.fy.fyspace.model.mq.ImageUploadMessage;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.amqp.AmqpException;
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource;
//
///**
// * 图片上传错误日志生产者
// */
//@Slf4j
//@Component
//public class ImageProducer {
//
//  @Resource
//  private RabbitTemplate rabbitTemplate;
//
//  /**
//   * 发送错误日志消息
//   */
//  public void sendErrorMessage(ImageUploadMessage message) {
//    try {
//      rabbitTemplate.convertAndSend(RabbitMQConfig.ERROR_EXCHANGE,
//          RabbitMQConfig.ERROR_ROUTING_KEY, message);
//      log.info("发送错误日志消息成功: {}", message);
//    } catch (Exception e) {
//      log.error("发送错误日志消息失败: {}", message, e);
//    }
//  }
//
//  /**
//   * 发送图片扩展结果
//   *
//   */
//  public void sendOutPaintingMessage(ImageOutPaintingMessage imo) {
//    try {
//      rabbitTemplate.convertAndSend(MQConstant.IMAGE_OUTPAINTING_EXCHANGE,
//              MQConstant.IMAGE_OUTPAINTING_ROUTING_KEY,
//              imo);
//      log.info("发送图片扩展结果成功: {}", imo);
//    } catch (Exception e) {
//      log.error("发送图片扩展结果失败: {}", imo, e);
//    }
//  }
//}